//
//  AIInAppPurchaseTool.h
//  Mia
//
//  Created by Vill on 2024/1/16.
//

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
@class SKPaymentTransaction;

NS_ASSUME_NONNULL_BEGIN

@interface AIInAppPurchaseTool : NSObject<SKPaymentTransactionObserver, SKProductsRequestDelegate>

+ (instancetype)sharedTool;

// 开始内购
- (void)startBuyProducts:(NSSet *)products;
@property (nonatomic, copy) void(^cannotStartBlock)(void);
@property (nonatomic, copy) void(^productNotExist)(void);
@property (nonatomic, copy) void(^requestErrorBlock)(NSError *error);
@property (nonatomic, copy) void(^buySuccessBlock)(SKPaymentTransaction *transaction);
@property (nonatomic, copy) void(^buyFailBlock)(NSString *message, SKPaymentTransaction *transaction);

@end

NS_ASSUME_NONNULL_END
